home *** CD-ROM | disk | FTP | other *** search
-
- *************************************************
- * *
- * *
- ************* QMJ version 5.31a ***************
- * *
- * *
- *************************************************
-
- A Shareware program to display the Mandelbrot Set, Complex and
- Quaternion Julia sets on the Amiga. Written by Chris Baxter in
- Hong Kong and Naples 1989-91. All Rights Reserved. Version 5.31a.
- Written in C and compiled with the Lattice C compiler version 5.05.
- The program may only be distributed with this notice and may not be
- published or sold without the author's prior consent. Neither the
- program nor the documentation may be altered in any way during its
- distribution or use. No fee may be taken for this program other than
- a minimal copying and media charge.
-
- The images on the distribution disk were produced on a standard PAL A500
- with 1 megabyte of memory. The full version of this program requires
- 1 megabyte to run; a cutdown version for 512k machines is available from
- the author, as is a large number of fractal images.
-
- *************************************************************************
- Based on ideas in these articles in 'Scientific American':-
-
- Aug. 1985 "Computer Recreations" p8 by A.K.Dewdney
- Nov. 1987 "Computer Recreations" p118 by A.K.Dewdney
- Feb. 1989 "Computer Recreations" p88 by A.K.Dewdney
-
- and this one in 'Fractal Report':-
-
- Issue 3 1989 "Quaternion Julia Sets" p2 by Dr Ian Entwhistle
-
-
- The Mathematical Theory
- =======================
-
- The Mandelbrot Set and Julia Sets are drawn by their coordinates in the
- Gaussian plane. The sets themselves appear in classical black in this
- program; it is the boundaries approaching the sets which are coloured
- and which provide the eye-catching image. Membership of the sets is a
- function of two variables:
-
- F(z,c): z -> z^2 + c
-
- where z and c are both complex numbers consisting of both a real and
- an imaginary part; the function is plotted by these two components, the
- imaginary axis being vertical (y) and the real one horizontal (x).
- The same function is used for both the Mandelbrot & Julia sets.
-
- The Mandelbrot Set is generated by setting z to zero initially and
- varying the value of c, therefore the points on the plane relate to the
- real & imaginary components of c. The Julia sets arise from fixing c
- and varying the value of z, so that the plotted points relate to the
- real and imaginary parts of the value of z.
-
- The Quaternion Julia set images are 2D slices through the 4D sets. The
- function that describes them is:
-
- F(Q,q): Q -> Q^2 +q
-
- Each of Q and q consist of a real part and components on the i, j and k
- axes of the 4D space. According to Hamiltonian algebra Q may be squared
- as follows:
- since Q = a+bi+cj+dk
- therefore Q^2 = (a+bi+cj+dk)(a+bi+cj+dk)
- = a^2+abi+acj+adk+bia+(bi)^2+bicj+bidk+cja+(cj)^2+
- cjdk+dka+dkbi+dkcj+(dk)^2
- but ij=ik=jk=ki=kj=0 (scalar multiplication)
- therefore Q^2 = a^2+2abi+2acj+2adk+(bi)^2+(cj)^2+(dk)^2
- but i^2 = j^2=k^2=-1
- therefore Q^2 = a^2-b^2-c^2-d^2+2abi+2acj+2adk
- Separating Q^2+q into real and imaginary components gives:
-
- 1. Qreal = a^2-b^2-c^2-d^2+qa
- 2. Qimag.i=2ab+qb
- 3. Qimag.j=2ac+qc
- 4. Qimag.k=2ad+qd
-
- For a 2D image the program can only use two planes to provide the
- screen mapping; in this program those corresponding to equations 1
- and 3 are used.
-
- It has been shown that if the size of either function ever reaches 2
- then it will continue towards infinity and the initial values used
- (depending on the type of set) do not lie within one of the sets. The
- colours of the images reflect the degree of boundedness that point has.
-
- To determine membership of the sets thousands of iterations might be
- required; the maximum iteration in this program (which means membership
- of the sets, if the size is still less than 2) may be varied to suit
- real time constraints - Dewdney reports that 100 may often be adequate.
- However, in practice it may be useful to preview an image using a low
- maximum iteration and small image size; if all is well reset the
- parameters and generate a larger image. Of course, closer to the sets
- the number of iterations required increases, so that images of these
- regions are slower to produce. On first loading an ffp produced image
- will be flagged as such to the user; an 'ieee' flag in the title bar
- tells you that the image was created in double precision maths. (Such
- flagging subsequently changes to suit the program actually being run.)
-
-
- Please Note
- -----------
- The fast floating point maths option of the program seems accurate
- enough when working to about 6 or 7 significant figures; beyond these
- limits use the standard double precision maths. Generating these
- images is heavy on floating point maths, so many of them can take some
- time to finish.
-
- With version 5.31 of this program you can:-
-
- ** generate images of the Mandelbrot Set
- ** generate images of the Julia Sets
- ** generate images of Quaternion Julia slices
- ** specify with the mouse which part of an image to enlarge
- ** save an image (compressed or uncompressed ILBM)
- ** reload an image (compressed/uncompressed ILBM format)
- ** continue a saved, but unfinished, image
- ** edit the colours used for drawing
- ** load only the palette from another image
- ** control the complete mathematical process
- ** choose the method for colouring the image
- ** send the image to the printer
- ** choose IEEE or FFP maths
- ** choose low or medium resolution modes
-
-
- History
- -------
-
- In version 5.0 several bugs were fixed and improvements made over v4.0 and
- earlier versions:-
-
- QMJ project icon startup was included
- saving now also saved an accompanying image icon
- the framing procedure was improved
- palette editing was enhanced
- the parameter screen was speeded up
- QMJ now ran as a background process linked with cback.o
-
- 5.10 Provided a choice of IEEE or FFP maths. The former are high
- precision routines that will use a maths coprocessor if it is
- present; the latter use the Motorola Fast Floating Point
- routines which are faster, but less accurate. An IEEE double is
- held in 64 bits; an FFP in only 32, so it clearly holds less
- information. The colour editing option was made to work during
- PAUSE. Loading a palette didn't blank the screen anymore.
-
- 5.20 used the MicroSmiths' file requester and returned colour editing
- to a draggable window, which is where it belongs.
-
- 5.30 prototyping & registerised parameters to speed things up. A new
- LowRes quick drawing mode.
-
- 5.31 Intro screen added. Help beefed up. Parameters speeded up. Fuller
- keyboard command support added.
-
- 5.31a uses a new file requester. Workbench 2 compatible.
-
- ** All versions PAL/NTSC compatible. When the program is run it
- detects the host video format and adapts itself to PAL or NTSC
- screen dimensions. The images supplied on the distribution disk are
- PAL and may require a full PAL screen (except the NTSC default
- image). If you've got an NTSC Amiga they either won't fit or
- they'll be distorted. Sorry about that.
-
- ***************************************************************************
-
- v5.31a Copyright (c) Chris Baxter October 1992
-
- 20 The Ridgeway
- Droitwich
- Worcs. WR9 8QB
- England
-
- The program & notes updated in Bilbao, Spain September 1992.
- You can contact me there until July 1994 at this address:
-
- calle Trauco 1, 3° izq
- 48007 Bilbao
- España
-
- **************************************************************************
-
- Disclaimer
- ==========
-
- This program is shareware and it may not be sold or distributed without
- its copyright notices. However, you use the code entirely at your own risk.
- No warranties are expressed or implied as to its fitness for any purpose.
-
- If you like the program and keep it, please send me US $10 (or equivalent),
- this will make you a registered user to whom the source code can be made
- available. Alternatively, send me some of your fractal work - programs
- and/or images.
-
- The program is in C and was compiled with Lattice C version 5.05. It's
- taken me a long time to get it into shape, so your support would be
- appreciated.
-
- Please report any bugs or suggestions so that they can be incorporated in
- future releases. Please feel free to contact me on any Amiga programming
- topic. I would, of course, be happy to receive any interesting images
- generated with this program.
-
-
- ***************************************************************************
-
- Please Note:
-
- For the program to run you must have
-
- mathieeedoubbas.library
- mathieeedountrans.library
-
- in the libs: directory.
-
- The distribution disk also uses MuchMorePoPa by Fridtjof Siebert of AMOK
- and BootIntro by Roger Fischlin - the author is grateful to them for their
- PD work.
-
- ***************************************************************************
-
- How to start the program:
- ========================
-
- either
- From WorkBench click on the appropriate QMJ icon
-
- or
- From the CLI type either qmj_pal or qmj_ntsc
-
- and the program will start.
-
- From WorkBench, if you have a previously saved QMJ image, click on the
- image icon and QMJ will automatically start up and then load the image.
-
-
- How to use the program:
- ======================
-
- The program starts up with an introduction to itself and the control keys it
- uses; hit any key (except HELP) or a mouse button to move on. Then the
- Mandelbrot Set (PAL or NTSC, depending on your system) will be displayed,
- unless you started the program from a project icon.
-
- The program is now waiting further instructions from you. You can either
- load or draw an image at this stage or change some of the program's
- parameters.
-
-
-
- The PROJECT menu
- ================
-
- SAVE will save the current screen image (subject to its current dimensions)
- and all of the parameters for generating the image. The image may be a
- standard IFF image or compressed according to the cmpByteRun1 run
- compression algorithm. (see Parameters) The parameters are held in a
- special chunk named 'QMJD', this is not a recognised IFF chunk. Other IFF
- readers should simply skip this chunk, if they are well written, so images
- should load into art programs etc. An icon will also be saved for the
- image; this is a project icon and will allow the image to be loaded
- automatically by double-clicking on it.
- ** See File Requester below.
-
- LOAD will ask for an ILBM (compressed or uncompressed) filename. If the
- ILBM image was not generated directly by QJM, an error will be reported,
- although the image may still load. This enables image 'processing' in
- DeluxePaint, for example, although you will need to re-type the image
- parameters (if you have a note of them) for them to be correct; this is
- because art programs and so on don't save the special parameter chunk. From
- version 5.0 an image can be loaded by clicking on its icon. If a version
- 4.0 (or earlier) image has no icon, copy an icon .info file generated
- under version 5.0 (or later) or the icon from some other project file (but
- don't forget to change the default tool). If the autoload of a project
- image fails, check the DEFAULT TOOL associated with the icon.
- ** See File Requester below.
-
- CLEAR will clear the screen.
-
- ABOUT gives a copyright notice. The program is SHAREWARE, not public
- domain. The author retains full copyright on source and executable code.
- The executable program must not be distributed without the full document-
- ation and copyright notices.
-
- PRINT will provide a screen dump of the current image to the printer. It
- will also print out the image's parameters.
-
- QUIT takes you out of QMJ via a requester to check you haven't goofed.
-
-
-
- The DRAW menu
- =============
-
- DRAW starts drawing an image. When the program is quiescent, waiting for a
- command, this will be the only option available on this menu. When an
- image is being produced, the DRAW option will be disabled and PAUSE
- and STOP will be possibilities.
-
- STOP halts the drawing of an image. If you SAVE an image that has been
- STOPped before completion and then reload it, the DRAW command will continue
- the image at the start of the current line. There may be a slight delay,
- if you have stopped and restarted an image in mid-line, while the program
- redraws the start of that line again. This option is useful for producing
- lengthy images, when you might not wish to leave the computer on; simply
- save the image and continue it later.
-
- PAUSE will halt the program, disabling all menu choices other than COLOUR
- (on the CHANGE menu) and DRAW. When the program's drawing is paused, you may
- change the palette using COLOUR on the CHANGE menu. To restart drawing
- select DRAW again; QMJ will pick up on the current image where it left off.
-
-
-
- The CHANGE menu
- ===============
-
- PARAMETERS calls up the program's control screen. At the top the current
- function to be iterated is indicated. Beneath it are the current
- parameters and their values. To alter one of these, click in the text area
- and simply type in or edit the values. The parameters available are:
- For Mandelbrots - the real & imaginary parts of c.
- For Complex Julias - the real and imaginary parts of z and c.
- For Quaternion Slices - the values a,b,c,d and qa,qb,qc,qd where
- Q=a+bi+cj+dk and q=qa+qbi+qcj+qdk; a and qa are real, all other parts are
- imaginary; i,j,k are vectors representing the square root of -1.
- Only the parameters required for the chosen function are available for
- input and editing, the others are ghosted out. To move to the next
- parameter, simply hit return or click with the mouse on the chosen gadget.
- Beneath these mathematical parameters are the current screen dimensions (in
- pixels). The maximum screen size is 640x246 on a PAL machine or 640x190
- on an NTSC screen. (The other 10 pixels are used for the title area.)
- At the bottom, on the left, there is the number of iterations to be
- performed before membership of the Mandelbrot or Julia sets is assumed.
- Any point that is iterated this number of times without its size reaching 2
- will be coloured black on the screen.
- On the right are 4 gadgets. At the top there is the gadget to specify the
- mode for colouring pixels. The possibilities are 'modulo', 'nonlinear' and
- 'linear'. Modulo shading means that when the function size reaches 2 for
- the point being iterated (ie. it doesn't reach the maximum number of
- iterations) the colour is determined by the number of iterations MOD 14
- (fourteen being the number of colours available). Each colour can
- represent several numbers of iterations under this scheme and it is often
- possible to see the range of colours repeated within the image. Linear
- implies an even, arithmetic spread of the 14 colours over the range up to
- the maximum number of iterations allowed. Nonlinear will spread the colours
- in a geometric progression over the given range of iterations, so that
- colours are more finely allocated further from membership of the sets.
- The second gadget on the right selects the function to be iterated,
- MANDELBROT, complex JULIA or QUATERNION Julia slice. The third gadget
- determines whether images will be saved compressed (in cmpByteRun1 run
- encoding) or uncompressed. The final gadget RETURNs you to the main
- screen.
-
- COLOUR will call the palette to allow editing of the colours the program
- uses for drawing. There are 14 colours used for drawing (plus black, used
- to show membership of a set in the 'traditional' way) and any of them may
- be altered as desired using Proportional Gadgets for their RGB components.
- Simply drag the RGB sliders to the intensity that you desire whilst
- watching the sample box displaying the current colour. The 16th colour is
- white and is used for titles etc. When you call up the parameters window,
- for example, QMJ will use false colours to make sure that you can read it.
-
- FRAME allows the user to select part of an image to investigate in greater
- detail. When you select FRAME you will be asked to click on the centre of
- the upper boundary of the new area. When you have done this you'll be
- asked to click on the centre of the lower boundary. The actual rectangle
- that you select will use these upper and lower bounds and the centre line
- you have indicated to produce an image appropriate to the current image
- proportions indicated on the parameter screen. (Note that the centre
- position isthe average of the upper and lower x positions when you
- clicked the left mouse button.) It's quite easy as the selection box will
- follow the mouse around, given the above constraints! At present there is
- no graphical way to select an image larger than the current one, other than
- going to the parameter screen and manually altering the parameters.
-
- SHOW TITLE will toggle between displaying the title-bar and hiding it.
- This can be useful when photographing the screen, for example.
-
- RESTORE DATA restores the data (available in the 'parameters window') to
- its state at the last LOAD or DRAW. This means that if you have an image
- loaded and make a mistake in framing, for example, you can get back to
- where you were before. CLEAR leaves you with only your current data and no
- old data to go back to. Generally this means that you can usually get back
- the parameters to suit the image on the screen.
-
- LOAD PALETTE will load the colour settings from another image without
- loading the image itself.
-
- FFFP / IEEE causes the program to change its maths precision. The default
- is IEEE so the menu will offer you FFP; if you select this item the
- program will draw faster, but less accurately. The menu wil show IEEE for
- the next selection; choose it again to return to double precision maths.
-
- LOWRES/MEDRES selects the resolution of the drawing. LowRes is almost 4
- times as fast as MedRes, as it plots 4 points per iteration ie. double
- points in both x & y directions. It is useful to get a quick idea of how
- a plot will look.
-
- RESET ALL returns the program to its initial startup state, possibly
- including a default screen, depending on the version.
-
-
- ** File Requester
- Version 5.31a uses a different file requester from previous versions of QMJ.
- The display at LOAD or SAVE will consist of two windows. On the left there
- are the normal gadgets to LOAD or SAVE, CANCEL or type in the path and file
- names required. On the right there is a separate file list window showing
- ONLY the directories and files with a ".qmj" extension in the current
- directory. To open a directory click ONCE on the directory name and it
- will be added to the path name on the left and its contents displayed. To
- go back a level click on "<<PARENT" at the top of the screen. Files can be
- selected in a similar way. The requester will not lose its contents
- between LOADs and SAVEs (to save you time). It will detect a change of disk
- in the current drive if the requester is up. If you need to refresh the
- display at any other time select "GET DIR". (N.B. RAMB0: is the RAD: unit
- name under normal conditions. If you want to change these use a binary
- file editor. What? You don't have one? Check out the PD libraries or
- contact me for a copy of AFEd - The Amiga File Editor.)
-
-
- ALL COMMANDS have alternate keyboard sequences:
- ==============================================
-
- SAVE Left-Amiga & S or just F5
- LOAD Left-Amiga & L or just F6
- CLEAR Left-Amiga & X or just F2
- ABOUT Left-Amiga & A or just HELP
- PRINT Left-Amiga & W
- QUIT Left-Amiga & Q or just ESC
- DRAW Left-Amiga & D
- STOP Left-Amiga & .
- PAUSE Left-Amiga & P
- PARAMETERS Left-Amiga & Z or just F3
- COLOUR Left-Amiga & C or just F4
- FRAME Left-Amiga & F or just F1
- SHOW TITLE Left-Amiga & T or just F10
- RESTORE DATA Left-Amiga & U
- LOAD PALETTE Left-Amiga & K or just F7
- FFP / IEEE Left-Amiga & M or just F8
- LOWRES / MEDRES Left-Amiga & O or just F9
- RESET ALL Left-Amiga & R
-
- Don't forget that AutoRequesters can be answered positively with
- Left-Amiga V and negatively with Right-Amiga B.
-
-
- I hope you enjoy using the program.
-
-
- Chris Baxter October 1992, Bilbao
-
-
-
-
-